import request from '@/config/axios'

export interface JournalismVO {
  id: number
  newsImg: string
  title: string
  content: string
  status: number
}

// 查询新闻管理列表
export const getJournalismPage = async (params) => {
  return await request.get({ url: `/hutai/journalism/page`, params })
}

// 查询新闻管理详情
export const getJournalism = async (id: number) => {
  return await request.get({ url: `/hutai/journalism/get?id=` + id })
}

// 新增新闻管理
export const createJournalism = async (data: JournalismVO) => {
  return await request.post({ url: `/hutai/journalism/create`, data })
}

// 修改新闻管理
export const updateJournalism = async (data: JournalismVO) => {
  return await request.put({ url: `/hutai/journalism/update`, data })
}

// 删除新闻管理
export const deleteJournalism = async (id: number) => {
  return await request.delete({ url: `/hutai/journalism/delete?id=` + id })
}

// 导出新闻管理 Excel
export const exportJournalism = async (params) => {
  return await request.download({ url: `/hutai/journalism/export-excel`, params })
}
